package com.metadata_system.common.db.mapper;

import com.metadata_system.common.db.entity.Config;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

public interface ConfigMapper extends Mapper<Config> {
    @Select("select last_insert_id()")
    int getLastInsertId();

    @Select("SELECT `content` FROM md_config WHERE `my_key`=#{currKey} LIMIT 1")
    String getValueByKey(String currKey);

    @Select("SELECT `id` FROM md_config WHERE `my_key`=#{currKey} LIMIT 1")
    Integer getIdByKey(String currKey);

    @Select("SELECT COUNT(*) FROM md_config")
    Integer test();
}
